﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////
#pragma once

// std headers
#include <iostream>
#include <map>

// custom headers
#include "GcsService.h"
#include "Major.h"


namespace gcmp
{
    class IDocument;
}

namespace gmepgcs
{
    class GCS_SERVICE_EXPORTS AppService
    {
    private:
        explicit AppService();
        AppService(AppService &) = default;
        AppService &operator=(AppService &) = default;
        virtual ~AppService()=default;

    public:
        static AppService *Get();

    public:
        static gcmp::IDocument *GetCurrentDocument();
        static std::wstring GetAppFileFullPath();
        static std::wstring GetAppDir();
        static std::wstring GetAppName();
        static bool IsGmep();
        static std::wstring GetProductName();
        static std::wstring GetProductVersion();
        static Major GetMajor();

    public:
        std::wstring GeFormattedProductVersion(std::wstring format = L"0.0");
        std::wstring GetProjectAppName();

    public:
        Major GetDebugMajor() { return m_debugMajor; };
        void SetDebugMajor(const Major &major) { m_debugMajor = major; };

    private:
        static AppService *s_pInstance;
        static std::wstring s_appFileFullPath;
        static std::wstring s_appDir;
        static std::wstring s_appName;
        static std::wstring s_productName;
        static std::wstring s_productVersion;

    private:
        std::map<std::wstring, std::wstring> m_mpFormattedProductVersion;
        Major m_debugMajor;
    };
}